package com.metaverse.backend.service;

import com.metaverse.backend.domain.PrivilegeOption;
import com.metaverse.backend.dto.PageQuery;
import com.metaverse.backend.repo.PrivilegeOptionRepo;
import com.metaverse.backend.utils.JpaUtils;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

@Service
@AllArgsConstructor
public class PrivilegeOptionService {

    private PrivilegeOptionRepo privilegeOptionRepo;

    public Page<PrivilegeOption> all(PageQuery pageQuery) {
        return privilegeOptionRepo.findAll(JpaUtils.toSpecification(pageQuery, PrivilegeOption.class), JpaUtils.toPageRequest(pageQuery));
    }
}
